ORDERLIST V2.1 FOR CE PHOENIX CART
=================================

Compatibility
-------------
CE Phoenix Cart 1.1.0.6
PHP 8.2

About
-----
Orderlist provides a compact Admin overview of orders, their delivery details,
products, selected attributes, payment method, totals and current status.

Filters are provided for order status, date range, order number, customer,
company, postcode, telephone and email address.

Each result provides buttons to open the standard Phoenix invoice and packing
slip in a new browser tab. Orderlist also provides an Email VAT Invoice button.
It creates a self-contained HTML invoice with the same browser and print layout
as Fancier Invoice V2.1, applies a Paid watermark, and attaches it to a branded
HTML message sent through the normal Phoenix email system. The central invoice
panel in the email is also a secure link to the same printable browser version.
A successful send is recorded in the order's status history.

When Advanced Order Manager is installed, clicking an order number opens the
order directly in AOM. If AOM is not installed, the link automatically falls
back to the standard Phoenix order editor.

Installation
------------
1. Rename the "admin" folder inside UPLOAD to match the actual name of your
   Phoenix Admin directory.
2. Upload the contents of the UPLOAD folder to the root of your shop, keeping
   the supplied directory structure.
3. Refresh the Phoenix Admin area.
4. Orderlist will appear beneath the Orders menu.
5. Open Orderlist and select "Paid invoice email settings". Tick only statuses
   that represent paid orders under your store policy, then save.

   If Customer Print Invoice V1.1 is installed, its existing allowed-status
   selection is reused until an Orderlist-specific selection is saved.

6. Filter Orderlist to a permitted status. The Email Paid Invoice button will
   be enabled when the saved order contains a valid customer email address.
   Confirm the displayed recipient to generate and send the attachment.

For the previously agreed store setup, select:
- Awaiting Approval
- In Pack
- Despatched
- Delivered

Upgrading
---------
Upload the complete V2.1 package over the previous Orderlist files. The first
save on the settings page adds one configuration row named
ORDERLIST_PAID_INVOICE_STATUS_IDS. The first send attempt also adds
a private signing key named ORDERLIST_PAID_INVOICE_LINK_SECRET for the secure
browser link. No new database table is created.

Files
-----
admin/orderlist.php
admin/orderlist_email_invoice.php
admin/orderlist_email_settings.php
admin/includes/orderlist_paid_invoice.php
admin/includes/boxes/orders_orderlist.php
includes/languages/english/orderlist.php
admin/includes/languages/english/modules/boxes/orders_orderlist.php
ext/orderlist_paid_invoice/orderlist_paid_invoice.css
includes/modules/orderlist_paid_invoice.php
orderlist_paid_invoice.php

Email and status behaviour
--------------------------
- The send action is accepted only from a valid Phoenix Admin session and
  requires Phoenix's form token.
- The order and current status are re-read immediately before HTML generation.
- A status that is not selected in settings cannot be sent a Paid invoice,
  even if the endpoint is requested directly.
- The destination always comes from the saved order. It cannot be supplied in
  the request URL or form.
- The order status is not changed.
- A successful send adds an order-history note. A failed send adds no success
  record and is written to the PHP/server error log.
- The browser link contains a cryptographically signed token. It does not reveal
  an Admin session and cannot be produced merely by guessing an order number.
- The browser invoice remains available only while its order is in one of the
  statuses permitted by the Orderlist settings.
- SEND_EMAILS must be enabled and the hosting mail configuration must already
  be capable of sending normal Phoenix emails.

Testing
-------
Test on a non-live order first. Confirm that the HTML file is attached, the Paid
watermark is visible, products/totals are correct, the email invoice panel opens
the browser version, and both copies print cleanly. Confirm that the send appears
once in the order history. Also confirm that the button is disabled for a
non-paid status and for an order with an invalid email address.

No Phoenix core files are modified.

Fancier Invoice compatibility
-----------------------------
Fancier Invoice and Packing Slip is not changed and is not required. Orderlist
uses a self-contained customer-safe copy of the Fancier Invoice V2.1 layout and
print styling. Admin-only order history, comments, hooks and watermark controls
are deliberately omitted; the emailed document always uses the Paid watermark.

The software is supplied without warranty under the GNU General Public License.
